<template>
	<view>
		<view class="image-info">
			<img class="image" :src="image" alt="" srcset="" @click="previewImage">
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				image:''
			}
		},
		async onLoad(options) {
			if (options.img) {
				this.image = options.img;
			}
		},
		methods:{
			previewImage(img) {
				let url = this.image;
				uni.previewImage({
					urls: [url]
				});
			},
		}
	}
</script>

<style lang="scss">
	.image-info{
		padding: 20rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		overflow: hidden;
		.image{
			max-width: 100%;
			height: auto;
		}
	}
</style>